$file1 = "3_most_output.txt";
$file2 = "./6/normalized_frma_normalcdf.txt";
open(BUFF1,$file1);
open(BUFF2,$file2);
open(WRBUFF,">./6/normalized_gene_frma_input.txt");
while($line = <BUFF1>)
{
	$line =~ s/\n//g;
	$line =~ s/\r//g;
	@array = split("\t",$line);
	$hash1{$array[1]} = $array[0];

}

$line = <BUFF2>;
print WRBUFF $line;
while($line = <BUFF2>)
{
	$gene = "";
        $line =~ s/\n//g;
        $line =~ s/\r//g;
        @array = split("\t",$line);
        $gene = $hash1{$array[0]};
	shift(@array);
	$line1 = join("\t",@array);
	if($gene ne "")
	{
		print WRBUFF $gene."\t".$line1."\n";
	}
	
}
